#!-*- coding:utf-8 -*-
from django.db import models
from django.contrib import admin
from django.contrib.auth.models import User
# Create your models here.

class Message(models.Model):
    title = models.CharField(max_length=100)
    content = models.CharField(max_length=1000)
    email = models.EmailField(blank=True)
    message_date = models.DateField(blank=True, null=True)
    
    def __unicode__(self):
        return self.title
    
    
admin.site.register(Message)
#基本信息
class UserInfo(models.Model):
    country = models.CharField(max_length=50)
    city = models.CharField(max_length=50)
    post_code =  models.CharField(max_length=50)
    address =  models.CharField(max_length=100)
    profile = models.CharField(max_length=600)
    user_describe = models.CharField(max_length=600)
    user = models.ForeignKey(User)
    
class UserInfoAdmin(admin.ModelAdmin):
    list_filter = ('address',)

admin.site.register(UserInfo,UserInfoAdmin)       

    